import React from 'react';
import { StyleSheet,Image,View,ScrollView } from 'react-native';
import { ListItem ,Button  } from 'react-native-elements';

import { removeAuthority} from '../utils/authority';
import { connect } from 'react-redux'
class SettingsScreen extends React.Component {
  static navigationOptions = {
    title: '设置',
  };

  render() {
    let { phone }=this.props.user.data;

    return (
      <ScrollView>

        <ListItem
            title='手机号'
            rightTitle={phone}
            bottomDivider={true}
        />
        <ListItem
            title='设置/修改密码'
            rightIcon={{name: 'ios-arrow-forward',type:'ionicon',color:'#6e6e6e'}}
            bottomDivider={true}
            onPress={()=>this.props.navigation.navigate('SavePassword') }
          />
        <ListItem
            title='检查更新版本'
            rightIcon={{name: 'ios-arrow-forward',type:'ionicon',color:'#6e6e6e'}}
            bottomDivider={true}
          />
        <Button title='退出登录'
            style={{marginVertical:10}}
            onPress={()=>{removeAuthority();this.props.navigation.navigate('Auth');} }
        />

    </ScrollView>
    )
  }
}
export default connect(({ user }) => ({user,}))(SettingsScreen);